package com.somedemo.bit_operation;

import javax.xml.crypto.Data;
import java.util.ArrayList;
import java.util.List;
import java.util.stream.Collectors;

public class StreamDemo001 {

    public static void main(String[] args) {
        List<StreamBody> list = new ArrayList<>();
        StreamBody streamBody = new StreamBody("lwc","25");
        StreamBody streamBody3 = new StreamBody("lwc2","25");
        StreamBody streamBody2 = new StreamBody("cwl","30");
        list.add(streamBody);
        list.add(streamBody2);
        list.add(streamBody3);
        List<StreamBody> lwc = list.stream().filter(i -> !i.getName().equals("cwl")).collect(Collectors.toList());
        System.out.println(lwc);
        List<StreamBody> collect = list.stream().distinct().collect(Collectors.toList());
        System.out.println(lwc);

    }
}

